package com.jinbooks.entity.merchant;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jinbooks.entity.BaseEntity;
import com.jinbooks.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 商户产品表 jbx_merchant_product
 *
 * @author lingma
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("jbx_merchant_product")
public class MerchantProduct extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @NotBlank(message = "ID不能为空", groups = {EditGroup.class})
    private String id;

    /**
     * 商户ID
     */
    private String merchantId;

    /**
     * 产品ID
     */
    private String productId;

    /**
     * 授权许可码
     */
    private String licenseKey;

    /**
     * 开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    /**
     * 结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    /**
     * 最大用户数
     */
    private Integer maxUserCount;

    /**
     * 状态（0-禁用 1-启用）
     */
    private Integer status;

    /**
     * 工作空间ID
     */
    private String workspaceId;

    /**
     * 删除标记：y-已删, n-正常
     */
    @TableField(fill = FieldFill.INSERT)
    @TableLogic(value = "n", delval = "y")
    private String deleted;
}